<script setup>
import bus from '../utils/bus.js'
import { onMounted, onBeforeUnmount } from 'vue'
onMounted(() => {
  bus.on('atob', num => {
    console.log('我是sona组件', num)
  })
})
onBeforeUnmount(() => {
  bus.off('atob')
})
</script>
<template>
  <div class="sonb"></div>
</template>
<style>
.sonb {
  width: 300px;
  height: 300px;
  background: #00f;
}
</style>
